#include "graphicstextitemsized.h"

GraphicsTextItemSized::GraphicsTextItemSized(QGraphicsItem* parent)
    : QGraphicsTextItem(parent)
    , height_(-1)
{
}

GraphicsTextItemSized::GraphicsTextItemSized(const QString& text, QGraphicsItem* parent)
    : QGraphicsTextItem(text, parent)
    , height_(-1)
{
}

QRectF GraphicsTextItemSized::boundingRect() const
{
    QRectF rect = QGraphicsTextItem::boundingRect();
    if (height_ >= 0)
        rect.setHeight(height_);
    return rect;
}
